package cn.com.pc.content.dto;

import cn.com.pc.content.domain.video.Video;
import cn.com.pc.content.domain.video.VideoStoreInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.beans.BeanUtils;

import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
@ToString(callSuper = true)
public class VideoDTO extends ContentDTO {
    private String token;
    private int duration;
    private List<VideoStoreInfo> videoStoreInfos;

    public static VideoDTO from(Video video) {
        VideoDTO videoDTO = new VideoDTO();
        BeanUtils.copyProperties(video, videoDTO);
        return videoDTO;
    }
}
